package utils;

import java.util.Arrays;
import java.util.PriorityQueue;
import java.util.Stack;

public class kuaipai {
    public static void main(String[] args) {
        int[] arr = new int[] {9,4,6,8,3,10,4,6};
        quickSort(arr,0,arr.length - 1);
        System.out.println(Arrays.toString(arr));
        String s="sdsds";
        s.toCharArray();
        Stack stack=new Stack();
        int a=0;



    }
    public static void quickSort(int[] arr,int low,int high) {
        if(low>=high){
            return ;
        }
        int i=low;
        int j=high;
        int a=arr[low];

        while(i<j){
            while(i<j&&arr[j]>=a){
                j--;
            }
            while (i<j&&arr[i]<=a){
                i++;
            }
            int t=arr[i];
            arr[i]=arr[j];
            arr[j]=t;
        }
        arr[low]=arr[i];
        arr[i]=a;
        quickSort(arr,0,i-1);
        quickSort(arr,i+1,high);
    }
}
